home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11342 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Four * Code
  5. Date: 22 Mar 1996 19:00:11 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4ivpfrINNhum@keats.ugrad.cs.ubc.ca>
  8. References: <4it4f6$oe4@news1.radix.net>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <4it4f6$oe4@news1.radix.net>, Jim Ward <jfw@radix.net> wrote:
  12. >When I first started in C, I ran into single *s: char*
  13. >Then double *s: char** argv
  14. >and yesterday I ran into a triple *: char*** nmptr;
  15. >nmptr is an argument for the UNIX function scandir(), and is to be
  16.  
  17. really? I checked the man page for scandir() both under SunOS 4.1.3 as well as
  18. HP-UX 9.03. On both systems, the nmptr argument is:
  19.  
  20.     struct dirent **nmptr;
  21.  
  22. The Linux man page and dirent.h header has it as ***nmptr---probably
  23. erroneously so. 
  24.  
  25. When you think about it, there is no need for a triple pointer to obtain a
  26. simple array of malloc'ed structures. You want a pointer to it, and you pass
  27. the address of this pointer so that it can be modified, hence a pointer to a
  28. pointer, or **.
  29. -- 
  30.  
  31.